money = 100
name = input("请输入您的姓名:")

def query_money(flag):
    if flag:
        print("-------余额查询---------")
    print(f"{name} 余额：{money}")


def save_money(saveMoney):
    global money
    money = money + saveMoney
    print(f"存款{saveMoney}成功")
    query_money(False)


def main():
    print()
    print()
    print("---------ATM业务-----------")
    print("查询，请输入【1】")
    print("存款，请输入【2】")
    print("退出，请输入【3】")
    return int(input("请输入选项："))


while True:
    key_input = main()
    if key_input == 1:
        query_money(True)
        continue
    elif key_input == 2:
        input_money = int(input("请输入存款金额："))
        save_money(input_money)
        continue
    else:
        break
